package com.patterns.mediator.SaleComputer;

/**
 * Created by Xiao Yiyun on 2017/4/29.
 * 场景类
 */
public class Client {
    public static void main(String[] args) {
        AbstractMediator mediator = new Mediatror();
        //采购人员采购电脑
        System.out.println("----------采购人员采购电脑-------------");
        Purchase purchase = new Purchase(mediator);
        purchase.buyComputer(100);
        //销售人员销售电脑
        System.out.println("------------销售人员销售电脑---------");
        Sale sale = new Sale(mediator);
        sale.sellComputer(1);
        //管理人员管理库存
        System.out.println("---------管理人员管理库存-------------");
        Stock stock = new Stock(mediator);
        stock.clearStock();
    }
}
